package net.crowdloud.client.tags;

import net.crowdloud.client.groups.GetGroups;
import net.crowdloud.shared.entities.Tags;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;

public class UpdateTags {

	public UpdateTags(final Tags tags) {

		final TagsDatabaseServerCallsAsync databaseServerCalls = GWT
				.create(TagsDatabaseServerCalls.class);

		databaseServerCalls.updateTags(tags, new AsyncCallback<Void>() {

			public void onSuccess(Void result) {

				new GetTags();

				new GetGroups();
			}

			public void onFailure(Throwable caught) {
				// Show the RPC error message to the user

			}

		});

	}
}
